<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>插件管理</title>
  <link rel="stylesheet" href="<?=adminassets?>assets/pear/component/pear/css/pear.css" />
</head>
<body class="pear-container">
    <?php if ($my == "list") : ?>
        <div class="layui-card">
      <div class="layui-card-body">
        <table id="news" lay-filter="news"></table>
      </div>
    </div>

    <script type="text/html" id="toolbar">
      <button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
        <i class="layui-icon layui-icon-add-1"></i>
        添加插件包
      </button>
    </script>


    <script type="text/html" id="options">
      <button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></button>
      <button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
    </script>
    <?php endif; ?>
    <?php if ($my == "add") : ?>
        <form class="layui-form" action="">
      <div class="mainBox">
        <div class="main-container">
          <div class="layui-form-item">
            <label class="layui-form-label">
              插件名称
            </label>
            <div class="layui-input-block">
              <input type="text" class="layui-input" name="name"  value="" placeholder="必填"/>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">
              下载地址
            </label>
            <div class="layui-input-block">
              <input type="text" class="layui-input" name="url"  value="" placeholder="必填"/>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">
              插件介绍
            </label>
            <div class="layui-input-block">
              <textarea class="layui-textarea" id="add_news" name="readme" placeholder="不支持html *必填"></textarea>
            </div>
          </div>
        </div>
      </div>
      <div class="bottom">
        <div class="button-container">
          <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="addSave">
            <i class="layui-icon layui-icon-ok"></i>
            提交
          </button>
          <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
            <i class="layui-icon layui-icon-refresh"></i>
            重置
          </button>
        </div>
      </div>
    </form>
    <?php endif; ?>
    <?php if ($my == "edit") : ?>
        <form class="layui-form" action="">
      <div class="mainBox">
        <div class="main-container">
          <input type="hidden" name="id" type="text" value="<?= $id ?>" />
          <div class="layui-form-item">
            <label class="layui-form-label">
              插件名称
            </label>
            <div class="layui-input-block">
              <input type="text" class="layui-input" name="title"  value="<?= $row['name'] ?>" />
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">
              下载地址
            </label>
            <div class="layui-input-block">
              <input type="text" class="layui-input" name="url"  value="<?= $row['url'] ?>" />
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">
              插件介绍
            </label>
            <div class="layui-input-block">
              <textarea class="layui-textarea" id="add_news" name="readme"><?= $row['readme'] ?></textarea>
            </div>
          </div>
        </div>
      </div>
      <div class="bottom">
        <div class="button-container">
          <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="editSave">
            <i class="layui-icon layui-icon-ok"></i>
            提交
          </button>
          <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
            <i class="layui-icon layui-icon-refresh"></i>
            重置
          </button>
        </div>
      </div>
    </form>
    <?php endif; ?>
<script src="<?=adminassets?>assets/pear/component/layui/layui.js"></script>
<script src="<?=adminassets?>assets/pear/component/pear/pear.js"></script>
<script type="text/javascript" src="../Core/assets/js/jquery.min.js"></script>
<script src="<?=adminassets?>assets/js/core_js/down.js"></script>